package cn.nebula.core.admin.action;

import cn.nebula.core.admin.service.SuperuserService;
import cn.nebula.core.base.action.BaseAction;
import cn.nebula.core.base.model.BaseUser;
import cn.nebula.core.user.service.UserService;

public class AdminAction extends BaseAction{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 5488436276449155738L;
	
	private SuperuserService adminService;
	
	private String loginname;
	
	private String loginpwd;
	
	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		return super.execute();
	}
	
	public String doLogin(){
		try {
			BaseUser adminUser =adminService.doLogin(loginname, loginpwd);
			if(adminUser==null){
				return INPUT;
			}
		} catch (Exception e) {
			e.printStackTrace();
			return INPUT;
		}
		return SUCCESS;
	}
	
	public SuperuserService getAdminService() {
		return adminService;
	}

	public void setAdminService(SuperuserService adminService) {
		this.adminService = adminService;
	}
	
	public String getLoginname() {
		return loginname;
	}

	public void setLoginname(String loginname) {
		this.loginname = loginname;
	}

	public String getLoginpwd() {
		return loginpwd;
	}

	public void setLoginpwd(String loginpwd) {
		this.loginpwd = loginpwd;
	}
}
